package com.map.util;

import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class ArrayUtil {
    public static String[][] listToArray(List result){
        //将List转换为二维数组String[][]
        String[][] z = new String[result.size()][];

        for(int i=0;i<z.length;i++){

            Map m = (Map)result.get(i);
            Set set = m.keySet();
            z[i] = new String[m.size()];
            Iterator it =set.iterator();

            for(int j=0;it.hasNext();j++){
                String s = (String)it.next();
                if(m.get(s)!=null){
                    z[i][j] =m.get(s).toString();
                }
            }
        }
        return z;
    }

}
